// ==========================================================================
// Dropdown.EntriesController
// ==========================================================================

require('core');

/** @class

  (Document Your View Here)

  @extends SC.Object
  @author AuthorName
  @version 0.1
  @static
*/
Dropdown.entriesController = SC.ArrayController.create(
/** @scope Dropdown.entriesController */ {

  // TODO: Add your own code here.
  observeEntrySelection: function()
  {alert("innn");
    if (this.get('selection').get('guid')!="")
      onEntrySelection(this.get('selection').get('guid'));
  }.observes('selection'),
  
  add: function()
  {
    
      var json = { "entries": 
     [ { "guid": "JSON1", "brand": "Mercl"},
       { "guid": "JSON2", "brand": "Jeep"}
     ], 
   "id":
   ["JSON1", "JSON2"]
};
     
    Array.forEach(json.entries, function(entry){Dropdown.Entry.newRecord({guid: entry.guid, brand: entry.brand});});

    //Dropdown.Entry.set('content',Dropdown.Entry.findAll());
    Dropdown.entriesController.set('content',Dropdown.Entry.findAll());
  //  Dropdown.entriesController.rebuildMenu();
  }
  
  

}) ;
